<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libCZI: libCZI::Utils Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libCZI
   </div>
   <div id="projectbrief">Reading CZI documents made easy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classlib_c_z_i_1_1_utils.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classlib_c_z_i_1_1_utils-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libCZI::Utils Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A bunch of utility functions.  
 <a href="classlib_c_z_i_1_1_utils.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="lib_c_z_i___utilities_8h_source.html">libCZI_Utilities.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ae97a98f63029f18282b1c940a79518a4"><td class="memItemLeft" align="right" valign="top">static char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#ae97a98f63029f18282b1c940a79518a4">DimensionToChar</a> (<a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424">libCZI::DimensionIndex</a> dim)</td></tr>
<tr class="separator:ae97a98f63029f18282b1c940a79518a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc8b44f500d3e3cda3dea381acca485a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424">libCZI::DimensionIndex</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#acc8b44f500d3e3cda3dea381acca485a">CharToDimension</a> (char c)</td></tr>
<tr class="separator:acc8b44f500d3e3cda3dea381acca485a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1718a9b6cf313114b8c70fd78befcf0a"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a1718a9b6cf313114b8c70fd78befcf0a">CalcMd5SumHash</a> (<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *bm, std::uint8_t *ptrHash, int hashSize)</td></tr>
<tr class="separator:a1718a9b6cf313114b8c70fd78befcf0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae31970caf0590b90fb85d4ff4a88cf1a"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#ae31970caf0590b90fb85d4ff4a88cf1a">CalcMd5SumHash</a> (const void *ptrData, size_t sizeData, std::uint8_t *ptrHash, int hashSize)</td></tr>
<tr class="separator:ae31970caf0590b90fb85d4ff4a88cf1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4602857b1d21eb75a0c7740a21297791"><td class="memItemLeft" align="right" valign="top">static std::vector&lt; std::uint8_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a4602857b1d21eb75a0c7740a21297791">Create8BitLookUpTableFromSplines</a> (int tableElementCnt, float blackPoint, float whitePoint, const std::vector&lt; <a class="el" href="structlib_c_z_i_1_1_i_display_settings_1_1_spline_data.html">libCZI::IDisplaySettings::SplineData</a> &gt; &amp;splineData)</td></tr>
<tr class="separator:a4602857b1d21eb75a0c7740a21297791"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3814604760096f9d0bb6f292de4fdf5f"><td class="memItemLeft" align="right" valign="top">static std::vector&lt; std::uint8_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a3814604760096f9d0bb6f292de4fdf5f">Create8BitLookUpTableFromGamma</a> (int tableElementCnt, float blackPoint, float whitePoint, float gamma)</td></tr>
<tr class="separator:a3814604760096f9d0bb6f292de4fdf5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d09549e8c5202874d5adc0cc1baccf7"><td class="memItemLeft" align="right" valign="top">static std::vector&lt; <a class="el" href="structlib_c_z_i_1_1_i_display_settings_1_1_spline_data.html">libCZI::IDisplaySettings::SplineData</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a1d09549e8c5202874d5adc0cc1baccf7">CalcSplineDataFromPoints</a> (int pointCnt, std::function&lt; std::tuple&lt; double, double &gt;(int idx)&gt; getPoint)</td></tr>
<tr class="separator:a1d09549e8c5202874d5adc0cc1baccf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af19f5d15750c0949f3dd4ebb5684c7d3"><td class="memItemLeft" align="right" valign="top">static std::shared_ptr&lt; <a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#af19f5d15750c0949f3dd4ebb5684c7d3">NearestNeighborResize</a> (<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *bmSrc, int dstWidth, int dstHeight)</td></tr>
<tr class="separator:af19f5d15750c0949f3dd4ebb5684c7d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d56f447db1707083cb47042729bfabf"><td class="memItemLeft" align="right" valign="top">static std::shared_ptr&lt; <a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a6d56f447db1707083cb47042729bfabf">NearestNeighborResize</a> (<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *bmSrc, int dstWidth, int dstHeight, const <a class="el" href="structlib_c_z_i_1_1_dbl_rect.html">DblRect</a> &amp;roiSrc, const <a class="el" href="structlib_c_z_i_1_1_dbl_rect.html">DblRect</a> &amp;roiDest)</td></tr>
<tr class="separator:a6d56f447db1707083cb47042729bfabf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68bf3739b6be924bcdf01664492f0a0a"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a68bf3739b6be924bcdf01664492f0a0a">CalcZoom</a> (const <a class="el" href="structlib_c_z_i_1_1_int_rect.html">libCZI::IntRect</a> &amp;logicalRect, const <a class="el" href="structlib_c_z_i_1_1_int_size.html">libCZI::IntSize</a> &amp;physicalSize)</td></tr>
<tr class="separator:a68bf3739b6be924bcdf01664492f0a0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00d20fac95c23043438c9326eb10bf53"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a00d20fac95c23043438c9326eb10bf53">PixelTypeToInformalString</a> (<a class="el" href="namespacelib_c_z_i.html#abf8ce12ab88b06c8b3b47efbb5e2e834">libCZI::PixelType</a> pxltp)</td></tr>
<tr class="separator:a00d20fac95c23043438c9326eb10bf53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb42843e65615302b51b68ad2b376e6d"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#aeb42843e65615302b51b68ad2b376e6d">DimCoordinateToString</a> (const <a class="el" href="classlib_c_z_i_1_1_i_dim_coordinate.html">libCZI::IDimCoordinate</a> *coord)</td></tr>
<tr class="separator:aeb42843e65615302b51b68ad2b376e6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69fdbdc41c4700f35a648a516757bbca"><td class="memItemLeft" align="right" valign="top">static std::shared_ptr&lt; <a class="el" href="classlib_c_z_i_1_1_i_index_set.html">libCZI::IIndexSet</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#a69fdbdc41c4700f35a648a516757bbca">IndexSetFromString</a> (const std::wstring &amp;s)</td></tr>
<tr class="separator:a69fdbdc41c4700f35a648a516757bbca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad105cc3a3791e6dd269116de0f71de04"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelib_c_z_i.html#abf8ce12ab88b06c8b3b47efbb5e2e834">libCZI::PixelType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlib_c_z_i_1_1_utils.html#ad105cc3a3791e6dd269116de0f71de04">TryDeterminePixelTypeForChannel</a> (<a class="el" href="classlib_c_z_i_1_1_i_sub_block_repository.html">libCZI::ISubBlockRepository</a> *repository, int channelIdx)</td></tr>
<tr class="separator:ad105cc3a3791e6dd269116de0f71de04"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A bunch of utility functions. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a1718a9b6cf313114b8c70fd78befcf0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1718a9b6cf313114b8c70fd78befcf0a">&#9670;&nbsp;</a></span>CalcMd5SumHash() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int libCZI::Utils::CalcMd5SumHash </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *&#160;</td>
          <td class="paramname"><em>bm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint8_t *&#160;</td>
          <td class="paramname"><em>ptrHash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>hashSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Calculates the MD5SUM hash for the pixels in the specified bitmap. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">bm</td><td>The bitmap. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ptrHash</td><td>Pointer to the hash-code result. The result will be of size 16 bytes. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">hashSize</td><td>Size of the hash-code result pointed to by <code>ptrHash</code>. We need 16 bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The count of bytes that were written to in ptrHash as the MD5SUM-hash (always 16). </dd></dl>

</div>
</div>
<a id="ae31970caf0590b90fb85d4ff4a88cf1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae31970caf0590b90fb85d4ff4a88cf1a">&#9670;&nbsp;</a></span>CalcMd5SumHash() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int libCZI::Utils::CalcMd5SumHash </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>ptrData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>sizeData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint8_t *&#160;</td>
          <td class="paramname"><em>ptrHash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>hashSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Calculates the MD5SUM hash for the specified data. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ptrData</td><td>Pointer to the data (for which to calculate the MD5SUM-hash). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sizeData</td><td>The size of the data (pointed to by ptrData). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ptrHash</td><td>Pointer to the hash-code result. The result will be of size 16 bytes. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">hashSize</td><td>Size of the hash-code result pointed to by <code>ptrHash</code>. We need 16 bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The count of bytes that were written to in ptrHash as the MD5SUM-hash (always 16). </dd></dl>

</div>
</div>
<a id="a1d09549e8c5202874d5adc0cc1baccf7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d09549e8c5202874d5adc0cc1baccf7">&#9670;&nbsp;</a></span>CalcSplineDataFromPoints()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::vector&lt;<a class="el" href="structlib_c_z_i_1_1_i_display_settings_1_1_spline_data.html">libCZI::IDisplaySettings::SplineData</a>&gt; libCZI::Utils::CalcSplineDataFromPoints </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pointCnt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::function&lt; std::tuple&lt; double, double &gt;(int idx)&gt;&#160;</td>
          <td class="paramname"><em>getPoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Calculates the spline coefficients from a list of control points. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pointCnt</td><td>Number of control points. </td></tr>
    <tr><td class="paramname">getPoint</td><td>A functor which will be used to retrieve the control point's coordinates. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The calculated spline data from the specified control points. </dd></dl>

</div>
</div>
<a id="a68bf3739b6be924bcdf01664492f0a0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68bf3739b6be924bcdf01664492f0a0a">&#9670;&nbsp;</a></span>CalcZoom()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float libCZI::Utils::CalcZoom </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structlib_c_z_i_1_1_int_rect.html">libCZI::IntRect</a> &amp;&#160;</td>
          <td class="paramname"><em>logicalRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structlib_c_z_i_1_1_int_size.html">libCZI::IntSize</a> &amp;&#160;</td>
          <td class="paramname"><em>physicalSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Calculate a zoom-factor from the physical- and logical size. </p><dl class="section remark"><dt>Remarks</dt><dd>This calculation not really well-defined. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">logicalRect</td><td>The logical rectangle. </td></tr>
    <tr><td class="paramname">physicalSize</td><td>Physical size. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The calculated zoom. </dd></dl>

</div>
</div>
<a id="acc8b44f500d3e3cda3dea381acca485a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc8b44f500d3e3cda3dea381acca485a">&#9670;&nbsp;</a></span>CharToDimension()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424">libCZI::DimensionIndex</a> libCZI::Utils::CharToDimension </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Convert the specifed single character to the corresponding dimension enum. The single character may be given uppercase or lowercase. In case that no corresponding dimension enum exists, <code><a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424afedb2d84cafe20862cb4399751a8a7e3" title="Invalid dimension index. ">DimensionIndex::invalid</a></code> is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>The "single char representation' of a dimension.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A enum value representing the specified dimension if it exists, <code><a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424afedb2d84cafe20862cb4399751a8a7e3" title="Invalid dimension index. ">DimensionIndex::invalid</a></code> otherwise. </dd></dl>

</div>
</div>
<a id="a3814604760096f9d0bb6f292de4fdf5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3814604760096f9d0bb6f292de4fdf5f">&#9670;&nbsp;</a></span>Create8BitLookUpTableFromGamma()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::vector&lt;std::uint8_t&gt; libCZI::Utils::Create8BitLookUpTableFromGamma </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tableElementCnt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>blackPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>whitePoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>gamma</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Creates 8-bit look-up table from the specified gamma value. An exponential with the specified gamma is sampled between <code>blackPoint</code> and <code>whitePoint</code> (i. e. points left of <code>blackPoint</code> are set to 0 and right of <code>whitePoint</code> are set to 1). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tableElementCnt</td><td>Number of points to sample - the result will have as many samples as specified here. </td></tr>
    <tr><td class="paramname">blackPoint</td><td>The black point. </td></tr>
    <tr><td class="paramname">whitePoint</td><td>The white point. </td></tr>
    <tr><td class="paramname">gamma</td><td>The gamma.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new 8-bit look up table generated from the spline. The number is elements is as specified by <code>tableElementCount</code>. </dd></dl>

</div>
</div>
<a id="a4602857b1d21eb75a0c7740a21297791"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4602857b1d21eb75a0c7740a21297791">&#9670;&nbsp;</a></span>Create8BitLookUpTableFromSplines()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::vector&lt;std::uint8_t&gt; libCZI::Utils::Create8BitLookUpTableFromSplines </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tableElementCnt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>blackPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>whitePoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="structlib_c_z_i_1_1_i_display_settings_1_1_spline_data.html">libCZI::IDisplaySettings::SplineData</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>splineData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Creates an 8-bit look-up table from the specifed splines. A spline is sampled between <code>blackPoint</code> and <code>whitePoint</code> (i. e. points left of <code>blackPoint</code> are set to 0 and right of <code>whitePoint</code> are set to 1). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tableElementCnt</td><td>Number of points to sample - the result will have as many samples as specified here. </td></tr>
    <tr><td class="paramname">blackPoint</td><td>The black point. </td></tr>
    <tr><td class="paramname">whitePoint</td><td>The white point. </td></tr>
    <tr><td class="paramname">splineData</td><td>Information describing the spline. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new 8-bit look up table generated from the spline. The number is elements is as specified by <code>tableElementCount</code>. </dd></dl>

</div>
</div>
<a id="aeb42843e65615302b51b68ad2b376e6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb42843e65615302b51b68ad2b376e6d">&#9670;&nbsp;</a></span>DimCoordinateToString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::string libCZI::Utils::DimCoordinateToString </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classlib_c_z_i_1_1_i_dim_coordinate.html">libCZI::IDimCoordinate</a> *&#160;</td>
          <td class="paramname"><em>coord</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get a string representation of the specified coordinate. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coord</td><td>The coordinate. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A string representation of the specified coordinate. </dd></dl>

</div>
</div>
<a id="ae97a98f63029f18282b1c940a79518a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae97a98f63029f18282b1c940a79518a4">&#9670;&nbsp;</a></span>DimensionToChar()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char libCZI::Utils::DimensionToChar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424">libCZI::DimensionIndex</a>&#160;</td>
          <td class="paramname"><em>dim</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Convert the specifed dimension enum to the corresponding "single char representation'. The returned character will be uppercase. If the specified dimension enum cannot be converted, '?' is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dim</td><td>The dimension enum.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A character representing the specified dimension. </dd></dl>

</div>
</div>
<a id="a69fdbdc41c4700f35a648a516757bbca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69fdbdc41c4700f35a648a516757bbca">&#9670;&nbsp;</a></span>IndexSetFromString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_index_set.html">libCZI::IIndexSet</a>&gt; libCZI::Utils::IndexSetFromString </td>
          <td>(</td>
          <td class="paramtype">const std::wstring &amp;&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Create an index-set object from a string representation. The string is a list of intervals, seperated by comma (','). It can be of the form "5", "17", "3-5", "-3-5". The string "inf" (meaning 'infinity') is recognized in order to express "all numbers up to" or "all numbers after" , e. g. "-inf-4" or "5-inf". In case of an invalid string, an <a class="el" href="classlib_c_z_i_1_1_lib_c_z_i_string_parse_exception.html" title="Exception for signalling that a string did not parse correctly. ">LibCZIStringParseException</a> exception is thrown. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>The string to convert to an index-set object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly create std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_index_set.html">libCZI::IIndexSet</a>&gt; object. </dd></dl>

</div>
</div>
<a id="af19f5d15750c0949f3dd4ebb5684c7d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af19f5d15750c0949f3dd4ebb5684c7d3">&#9670;&nbsp;</a></span>NearestNeighborResize() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt; libCZI::Utils::NearestNeighborResize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *&#160;</td>
          <td class="paramname"><em>bmSrc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dstWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dstHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Resize the specified bitmap to the specified width and height. This method employs a nearest-neighbor-scaling algorihm. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">bmSrc</td><td>The source bitmap. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">dstWidth</td><td>Width of the destination. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">dstHeight</td><td>Height of the destination. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt; containing the scaled bitmap. </dd></dl>

</div>
</div>
<a id="a6d56f447db1707083cb47042729bfabf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d56f447db1707083cb47042729bfabf">&#9670;&nbsp;</a></span>NearestNeighborResize() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt; libCZI::Utils::NearestNeighborResize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> *&#160;</td>
          <td class="paramname"><em>bmSrc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dstWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dstHeight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structlib_c_z_i_1_1_dbl_rect.html">DblRect</a> &amp;&#160;</td>
          <td class="paramname"><em>roiSrc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structlib_c_z_i_1_1_dbl_rect.html">DblRect</a> &amp;&#160;</td>
          <td class="paramname"><em>roiDest</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Resize a ROI from the specified bitmap to the specified width and height. This method employs a nearest-neighbor-scaling algorihm. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">bmSrc</td><td>The source bitmap. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">dstWidth</td><td>Width of the destination. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">dstHeight</td><td>Height of the destination. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">roiSrc</td><td>The ROI (in the source bitmap). </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">roiDest</td><td>The ROI (in the destination bitmap) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A std::shared_ptr&lt;<a class="el" href="classlib_c_z_i_1_1_i_bitmap_data.html">libCZI::IBitmapData</a> &gt; </dd></dl>

</div>
</div>
<a id="a00d20fac95c23043438c9326eb10bf53"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00d20fac95c23043438c9326eb10bf53">&#9670;&nbsp;</a></span>PixelTypeToInformalString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const char* libCZI::Utils::PixelTypeToInformalString </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacelib_c_z_i.html#abf8ce12ab88b06c8b3b47efbb5e2e834">libCZI::PixelType</a>&#160;</td>
          <td class="paramname"><em>pxltp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Retrieves an informal string representing the specified pixeltype.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pxltp</td><td>The pixel-type.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to a static string. Will always be non-null (even in case of an invalid value for <code>pxltp</code>. </dd></dl>

</div>
</div>
<a id="ad105cc3a3791e6dd269116de0f71de04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad105cc3a3791e6dd269116de0f71de04">&#9670;&nbsp;</a></span>TryDeterminePixelTypeForChannel()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="namespacelib_c_z_i.html#abf8ce12ab88b06c8b3b47efbb5e2e834">libCZI::PixelType</a> libCZI::Utils::TryDeterminePixelTypeForChannel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classlib_c_z_i_1_1_i_sub_block_repository.html">libCZI::ISubBlockRepository</a> *&#160;</td>
          <td class="paramname"><em>repository</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channelIdx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Try to determine the pixel type for channel. This is done by looking at an (arbitrary) subblock within the specified channel. There are cases where this does not yield a result - e. g. if there is no subblock present with the specified channel-index. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">repository</td><td>The CZI-document. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">channelIdx</td><td>The channel index.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The pixeltype if it can be determined. If it cannot be determined reliably (e.g. there is no subblock with the specified channel-index), then <a class="el" href="namespacelib_c_z_i.html#abf8ce12ab88b06c8b3b47efbb5e2e834a4bbb8f967da6d1a610596d7257179c2b" title="Invalid pixel type. ">PixelType::Invalid</a> is returned. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>libCZI/<a class="el" href="lib_c_z_i___utilities_8h_source.html">libCZI_Utilities.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacelib_c_z_i.html">libCZI</a></li><li class="navelem"><a class="el" href="classlib_c_z_i_1_1_utils.html">Utils</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
